{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "9ace0bb9-3612-4210-93af-fbbb44dcc37e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "          代码      名称     最新价    涨跌额    涨跌幅      买入      卖出      昨收      今开  \\\n",
      "0   sz180901  润泽REIT   6.160 -0.106 -1.692   6.160   6.163   6.266   6.228   \n",
      "1   sz180801    首钢绿能  12.039 -0.028 -0.232  12.031  12.039  12.067  12.059   \n",
      "2   sz180701    绍兴原水   4.110 -0.009 -0.218   4.110   4.113   4.119   4.119   \n",
      "3   sz180607    中海商业   5.504 -0.015 -0.272   5.503   5.504   5.519   5.493   \n",
      "4   sz180606    中金绿发   4.080 -0.036 -0.875   4.057   4.070   4.116   4.130   \n",
      "..       ...     ...     ...    ...    ...     ...     ...     ...     ...   \n",
      "72  sh508005    首创奥莱   4.040 -0.030 -0.737   4.039   4.040   4.070   4.094   \n",
      "73  sh508003    中金联东   3.860  0.024  0.626   3.859   3.860   3.836   3.813   \n",
      "74  sh508002    百联消费   3.033 -0.004 -0.132   3.024   3.030   3.037   3.026   \n",
      "75  sh508001    浙江杭徽   7.047 -0.079 -1.109   7.046   7.047   7.126   7.126   \n",
      "76  sh508000  张江REIT   2.641 -0.006 -0.227   2.641   2.645   2.647   2.640   \n",
      "\n",
      "        最高      最低      成交量       成交额  \n",
      "0    6.259   6.121  3192998  19783341  \n",
      "1   12.059  12.030   330697   3981843  \n",
      "2    4.130   4.102  2738900  11278778  \n",
      "3    5.521   5.492  1072620   5908591  \n",
      "4    4.130   4.055   276122   1131262  \n",
      "..     ...     ...      ...       ...  \n",
      "72   4.240   4.010  1045900   4246767  \n",
      "73   4.152   3.796   759900   2945659  \n",
      "74   3.060   3.016   602300   1825300  \n",
      "75   7.126   7.032  1129379   7974958  \n",
      "76   2.663   2.626  1186428   3129964  \n",
      "\n",
      "[77 rows x 13 columns]\n"
     ]
    }
   ],
   "source": [
    "# 基金列表获取： https://akshare.akfamily.xyz/data/fund/fund_public.html#id12\n",
    "\n",
    "import akshare as ak\n",
    "\n",
    "fund_etf_category_sina_df = ak.fund_etf_category_sina(symbol=\"封闭式基金\")\n",
    "print(fund_etf_category_sina_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "99748ee4-e4de-44c0-b381-0c3f4e618505",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "            date   open   high    low  close    volume     amount\n",
      "0     2020-06-05  3.891  3.902  3.873  3.878  20455775   79632456\n",
      "1     2020-06-08  3.860  3.860  3.830  3.843  10948250   41992806\n",
      "2     2020-06-09  3.844  3.856  3.838  3.840   7578584   29136540\n",
      "3     2020-06-10  3.849  3.882  3.849  3.881   2099339    8143254\n",
      "4     2020-06-11  3.893  3.913  3.893  3.910   9669907   37765509\n",
      "...          ...    ...    ...    ...    ...       ...        ...\n",
      "1321  2025-11-17  9.008  9.025  8.901  8.942  79355602  711540577\n",
      "1322  2025-11-18  8.898  8.898  8.830  8.854  70713900  626297670\n",
      "1323  2025-11-19  8.940  9.028  8.933  9.012  65702000  590206257\n",
      "1324  2025-11-20  9.017  9.030  8.925  8.964  54014200  484589276\n",
      "1325  2025-11-21  8.952  8.980  8.885  8.897  76874200  686369465\n",
      "\n",
      "[1326 rows x 7 columns]\n"
     ]
    }
   ],
   "source": [
    "# 基金详情获取： https://akshare.akfamily.xyz/data/fund/fund_public.html#id12\n",
    "import akshare as ak\n",
    "\n",
    "fund_etf_hist_sina_df = ak.fund_etf_hist_sina(symbol=\"sh518850\")\n",
    "print(fund_etf_hist_sina_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "cf4233b7-0618-4cad-b811-aa9cd717f92f",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "                                                             \r"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "            代码    名称     最新价    涨跌额     涨跌幅      买入      卖出      昨收      今开  \\\n",
      "0     bj920000  安徽凤凰   21.99  -0.20  -0.901   21.98   22.00   22.19   22.18   \n",
      "1     bj920001  纬达光电   21.80   0.80   3.810   21.79   21.80   21.00   21.53   \n",
      "2     bj920002  万达轴承  107.75   0.05   0.046  107.75  108.00  107.70  107.00   \n",
      "3     bj920003  中诚咨询   35.63   0.65   1.858   35.63   35.66   34.98   34.83   \n",
      "4     bj920005  鼎佳精密   46.22   0.36   0.785   46.18   46.22   45.86   45.90   \n",
      "...        ...   ...     ...    ...     ...     ...     ...     ...     ...   \n",
      "5442  sz301662  宏工科技  136.43  14.85  12.214  136.07  136.43  121.58  120.01   \n",
      "5443  sz301665  泰禾股份   31.64   0.04   0.127   31.63   31.64   31.60   31.60   \n",
      "5444  sz301668  昊创瑞通   56.40  -1.00  -1.742   56.40   56.41   57.40   56.60   \n",
      "5445  sz301678   新恒汇   69.67  -1.40  -1.970   69.66   69.67   71.07   70.31   \n",
      "5446  sz302132  中航成飞   82.47   1.41   1.739   82.46   82.47   81.06   80.80   \n",
      "\n",
      "          最高      最低        成交量          成交额  \n",
      "0      22.30   21.70  1413852.0   31014766.0  \n",
      "1      22.68   21.47  3426688.0   75585960.0  \n",
      "2     108.91  106.20   382993.0   41195542.0  \n",
      "3      36.10   34.70  1730521.0   61558638.0  \n",
      "4      46.32   45.81   223345.0   10313226.0  \n",
      "...      ...     ...        ...          ...  \n",
      "5442  138.33  117.55  3198376.0  413376653.0  \n",
      "5443   32.12   31.33  2637649.0   83700332.0  \n",
      "5444   57.30   56.26  1453082.0   82180860.0  \n",
      "5445   70.81   69.40  1336791.0   93263730.0  \n",
      "5446   82.86   80.64  6963749.0  571358038.0  \n",
      "\n",
      "[5447 rows x 13 columns]\n"
     ]
    }
   ],
   "source": [
    "import akshare as ak\n",
    "\n",
    "stock_zh_a_spot_df = ak.stock_zh_a_spot()\n",
    "print(stock_zh_a_spot_df)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
